package com.hunray.rent.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
@Entity
@Table(name="t_device_rent")
public class DeviceRent  implements Serializable{

	private static final long serialVersionUID = 1L;
	
	private Integer id;
	
	private Device device;
	
	private Rent rent;
	@Id
	@GeneratedValue(strategy=GenerationType.TABLE,generator="tg_device_rent")
	@TableGenerator(name="tg_device_rent",table="t_id",pkColumnName="f_table",pkColumnValue="t_device_rent",valueColumnName="f_id",initialValue=1,allocationSize=1)
	@Column(name="f_id")
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="f_device")
	public Device getDevice() {
		return device;
	}

	public void setDevice(Device device) {
		this.device = device;
	}
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="f_rent")
	public Rent getRent() {
		return rent;
	}

	public void setRent(Rent rent) {
		this.rent = rent;
	}
	
	

}
